package com.wicket.okrpbff.web.contorller;

import com.wicket.okrpbff.biz.service.TypeCodeService;
import com.wicket.okrpbff.biz.service.dto.req.*;
import com.wicket.okrpbff.biz.service.dto.res.*;
import com.wicket.okrpbff.common.ro.OkrResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import com.wicket.okrframework.integration.FwBaseTypeCodeClient;
import com.wicket.okrframework.integration.dto.QueryTypeListRespDto;
import com.wicket.okrframework.integration.dto.QueryTypeListReqDto;
import com.wicket.okrpbff.biz.service.dto.common.BffBaseMetadataTypeDto;
import cn.hutool.core.bean.BeanUtil;
import java.util.stream.Collectors;
import com.wicket.okrframework.integration.dto.AddTypeRespDto;
import com.wicket.okrframework.integration.dto.AddTypeReqDto;
import com.wicket.okrpbff.common.exception.Assert;
import com.wicket.okrframework.integration.dto.UpdateTypeRespDto;
import com.wicket.okrframework.integration.dto.UpdateTypeReqDto;
import com.wicket.okrframework.integration.dto.QueryTypeDetailRespDto;
import com.wicket.okrframework.integration.dto.QueryTypeDetailReqDto;
import com.wicket.okrframework.integration.FwBaseInductionRecordClient;
import com.wicket.okrframework.integration.dto.QueryInductionRecordInfoDetailComRespDto;
import com.wicket.okrframework.integration.dto.QueryInductionRecordInfoDetailComReqDto;
import com.wicket.okrframework.integration.dto.BatchQueryInductionRecordListComRespDto;
import com.wicket.okrframework.integration.dto.BatchQueryInductionRecordListComReqDto;
import cn.hutool.core.collection.CollectionUtil;
import com.wicket.okrframework.integration.dto.QueryCodeListRespDto;
import com.wicket.okrframework.integration.dto.QueryCodeListReqDto;
import com.wicket.okrpbff.biz.service.dto.common.BffTypeEncodingDto;
import com.wicket.okrframework.integration.dto.UpdateCodeRespDto;
import com.wicket.okrframework.integration.dto.UpdateCodeReqDto;
import com.wicket.okrframework.integration.dto.AddCodeRespDto;
import com.wicket.okrframework.integration.dto.AddCodeReqDto;

/**
 * @author ：
 * @date ：
 *
 *
 * @version 1.0
 */
@Api(value = "TypeCode", tags = {"TypeCode"})
@RestController
// @RequestMapping("/poms/typeCode/")
public class TypeCodeController {
    @Autowired
    TypeCodeService typeCodeService;

    /**
   * B1-1新增类型（平台）
   * gen by moon at 10/25/2022, 10:01:08 AM
   */
    @PostMapping("/oms/platform/typeCode/addType")
    @ApiOperation(value = "B1-1新增类型（平台）", response = OkrResult.class)
    public OkrResult<BffAddTypeRespDto> addType(@RequestBody(required=false) @Validated BffAddTypeReqDto reqDTO){
        return OkrResult.success(typeCodeService.addType(reqDTO));
    }

    /**
   * B1查询存档条件编码列表（平台）
   * gen by moon at 8/10/2022, 3:44:18 AM
   */
    @PostMapping("/oms/platform/typeCode/queryArchiveCodeList")
    @ApiOperation(value = "B1查询存档条件编码列表（平台）", response = OkrResult.class)
    public OkrResult<BffQueryArchiveCodeListRespDto> queryArchiveCodeList(@RequestBody(required=false) @Validated BffQueryArchiveCodeListReqDto reqDTO){
        return OkrResult.success(typeCodeService.queryArchiveCodeList(reqDTO));
    }

    /**
   * B1-1查询枚举对象属性下编码列表
   * gen by moon at 8/10/2022, 3:41:03 AM
   */
    @PostMapping("/oms/platform/typeCode/queryEnumerateCodeList")
    @ApiOperation(value = "B1-1查询枚举对象属性下编码列表", response = OkrResult.class)
    public OkrResult<BffQueryEnumerateCodeListRespDto> queryEnumerateCodeList(@RequestBody(required=false) @Validated BffQueryEnumerateCodeListReqDto reqDTO){
        return OkrResult.success(typeCodeService.queryEnumerateCodeList(reqDTO));
    }

    /**
   * B1-1新增编码（平台）
   * gen by moon at 8/17/2022, 8:03:49 PM
   */
    @PostMapping("/oms/platform/typeCode/addCode")
    @ApiOperation(value = "B1-1新增编码（平台）", response = OkrResult.class)
    public OkrResult<BffAddCodeRespDto> addCode(@RequestBody(required=false) @Validated BffAddCodeReqDto reqDTO){
        return OkrResult.success(typeCodeService.addCode(reqDTO));
    }

    /**
   * B1-1修改编码（平台）
   * gen by moon at 8/10/2022, 3:40:08 AM
   */
    @PostMapping("/oms/platform/typeCode/updateCode")
    @ApiOperation(value = "B1-1修改编码（平台）", response = OkrResult.class)
    public OkrResult<BffUpdateCodeRespDto> updateCode(@RequestBody(required=false) @Validated BffUpdateCodeReqDto reqDTO){
        return OkrResult.success(typeCodeService.updateCode(reqDTO));
    }

    /**
   * B1-1查询编码列表（平台）
   * gen by moon at 8/10/2022, 3:40:04 AM
   */
    @PostMapping("/oms/platform/typeCode/queryCodeList")
    @ApiOperation(value = "B1-1查询编码列表（平台）", response = OkrResult.class)
    public OkrResult<BffQueryCodeListRespDto> queryCodeList(@RequestBody(required=false) @Validated BffQueryCodeListReqDto reqDTO){
        return OkrResult.success(typeCodeService.queryCodeList(reqDTO));
    }

    /**
   * B1-1查询类型列表（平台）
   * gen by moon at 10/24/2022, 9:56:01 PM
   */
    @PostMapping("/oms/platform/typeCode/queryTypeList")
    @ApiOperation(value = "B1-1查询类型列表（平台）", response = OkrResult.class)
    public OkrResult<BffQueryTypeListRespDto> queryTypeList(@RequestBody(required=false) @Validated BffQueryTypeListReqDto reqDTO){
        return OkrResult.success(typeCodeService.queryTypeList(reqDTO));
    }

    /**
   * B1-1查询类型详情（平台）
   * gen by moon at 8/10/2022, 3:39:20 AM
   */
    @PostMapping("/oms/platform/typeCode/queryTypeDetail")
    @ApiOperation(value = "B1-1查询类型详情（平台）", response = OkrResult.class)
    public OkrResult<BffQueryTypeDetailRespDto> queryTypeDetail(@RequestBody(required=false) @Validated BffQueryTypeDetailReqDto reqDTO){
        return OkrResult.success(typeCodeService.queryTypeDetail(reqDTO));
    }

    /**
   * B1-1修改类型（平台）
   * gen by moon at 8/10/2022, 3:39:19 AM
   */
    @PostMapping("/oms/platform/typeCode/updateType")
    @ApiOperation(value = "B1-1修改类型（平台）", response = OkrResult.class)
    public OkrResult<BffUpdateTypeRespDto> updateType(@RequestBody(required=false) @Validated BffUpdateTypeReqDto reqDTO){
        return OkrResult.success(typeCodeService.updateType(reqDTO));
    }
/**
   * B1-1查询类型列表（边界）
   * gen by moon at 8/10/2022, 3:42:53 AM
   */
    @PostMapping("/oms/platform/typeCode/queryTypeListBorder")
    @ApiOperation(value = "B1-1查询类型列表（边界）", response = OkrResult.class)
    public OkrResult<BffQueryTypeListBorderRespDto> queryTypeListBorder(@RequestBody(required=false) @Validated BffQueryTypeListBorderReqDto reqDTO){
        return OkrResult.success(typeCodeService.queryTypeListBorder(reqDTO));
    }

}

